Ext.onReady(function() {
	
	var geoMapPanel = new GBIF.GeoSpatial.MapComponent({
				height:400
			,	zoom:2
			,	renderTo:'map'
	});
	
	var veclayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                    "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
    geoMapPanel.map.addLayer(veclayer);
           
	var yelp = new OpenLayers.Icon("../../resources/images/bin.png", new OpenLayers.Size(10,15));
	var layer = new OpenLayers.Layer.GML("KML"
				, 	"../../resources/json/sundials.kml"
				,   {
                		format: OpenLayers.Format.KML 
                	,	'icon':yelp
					,	formatOptions: {
                  				extractStyles: true 
                  			,	extractAttributes: true
                			}
               });
	  var selectControl = new GBIF.GeoSpatial.SelectFeature(layer);
  
      geoMapPanel.map.addControl(selectControl);
      selectControl.activate();   
      geoMapPanel.map.zoomToMaxExtent();
	  geoMapPanel.map.addLayer(layer);
	
	
});

